﻿@model smartcrm.Models.CustomerStatement

@{
    ViewBag.Title = "客户对账单";
}

<script src="../../Scripts/customerstatement.js"></script>
<div id="dSearch" class="divSearch">
<form method="post">   
    <table>
        <tr>
            <td class="label">客户：</td>
            <td>@Html.DropDownList("sc", new SelectList(Model.DdlCustomer, "ItemValue", "ItemText"))</td>
            <td class="label">客户：</td>
            <td>
                起始时间：@Html.TextBox("sb", null, new { maxlength = "50", @title="双击清空"}) ~ @Html.TextBox("se", null, new { maxlength = "50", @title = "双击清空" })
                <span class="redStar"></span>
                <input type="submit" onclick="javascript:return checkField()" id="btnSearch" value="搜索" />
            </td>
        </tr>
    </table>  
</form>
</div>

<div id="Statement">       
    <form action ="/Order/GetPdf">
    <div class="FR"><input type="button" value="下载对账单" id="btnExport"  /> </div>
    </form>
    <div class="list">
        <table id="tOrder">
            <thead>
                <tr>
                    <th style="width:70px">交易日期</th>
                    <th style="width:90px">客户</th> 
                    <th style="width:90px">订单编号</th>                     
                    <th>订单名称</th>
                    <th>订单明细</th>
                    <th style="width:65px">支付状态</th> 
                     <th style="width:50px">数量</th>
                    <th style="width:70px">金额</th>
                    <th style="width:70px">已付</th>
                    <th style="width:70px">未付</th> 
                </tr>
            </thead>
            <tbody>
            @foreach (var item in Model.Orders)
                    {
                        <tr id="@item.OrderNo">
                            <td>@item.TransactionDate.ToString("yyyy-MM-dd")</td>
                            <td>@Html.DisplayFor(modelItem => item.CustomerShortName)</td>                              
                            <td>@Html.DisplayFor(modelItem => item.OrderNo)</td>  
                            <td>@Html.DisplayFor(modelItem => item.OrderName)</td>   
                            <td>
                                @item.CategoryName
                                (@item.DetailText)
                            </td>    
                            <td>@Html.DisplayFor(modelItem => item.PaymentStatusDescription)</td>                  
                            <td>@Html.DisplayFor(modelItem => item.Number)</td>
                            <td>@Html.DisplayFor(modelItem => item.Amount)</td>
                            <td>@Html.DisplayFor(modelItem => item.Paid)</td>
                            <td>@Html.DisplayFor(modelItem => item.Unpaid)</td>   
                        </tr>
                    }
                    <tr class="totalTd">
                    <td>总计：</td>      
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td class="oderAmountTotal">@Model.TotalAmount</td>    
                    <td class="oderAmountTotal">@Model.TotalPaid</td>    
                    <td class="oderAmountTotal">@Model.TotalUnpaid</td> 
                    </tr>
            </tbody>
        </table>
    </div>
</div>


